package com.huamao.niceman.scrollviewpager.triangleviewpagerindicator;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * Created by LuanXianSheng on 2017/6/6.
 */

public class VpSimpleFragment extends Fragment {
    private static final String BUNDLE_TITLE="title" ;
    private String mTitle ;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle b) {
        Bundle bundle = getArguments() ;
        if (bundle != null){
            mTitle = bundle.getString(BUNDLE_TITLE) ;
        }
        TextView tv = new TextView(getContext()) ;
        tv.setText(mTitle+"");
        tv.setTextSize(50);
        tv.setGravity(Gravity.CENTER);
        return tv;
    }

    public static  VpSimpleFragment newInstance(String title){
        Bundle bundle = new Bundle() ;
        bundle.putString(BUNDLE_TITLE,title);
        VpSimpleFragment fragment = new VpSimpleFragment();
        fragment.setArguments(bundle);
        return fragment ;
    }
}
